* Codebook of the variables in the dataset:

* party: name of the Italian parliamentary group
* mission: Mission related to troop deployments (see also Table 4 of the paper)
* lr: left-right ideological placement of parties
* gov: 1 for cabinet parties; 0 otherwise
* mission_name: country involved in the military mission_name
* year: year of the legislative debate
* debate: # of debates related to a specific mission
* multilateralism: % of a legislative debate devoted to a the multilateralism topic as extracted from the seeeded LDA
* humanitarian_dimensio: % of a legislative debate devoted to a the humanitarian topic as extracted from the seeeded LDA
* war: % of a legislative debate devoted to a the war topic as extracted from the seeeded LDA

******* Codebook of the variables

clear
* import delimited "....\scores_slda.csv"
encode party, gen(code)

* let's stadardize to 100 the values for multilateralism, humanitarian_dimensio, and war
gen multi100 = multilateralism/(multilateralism+humanitarian_dimensio+war)
gen humi100 = humanitarian_dimensio/(multilateralism+humanitarian_dimensio+war)
gen war100 = war/(multilateralism+humanitarian_dimensio+war)

**** replicate Table 5
* Model 1
reg multi100 c.lr##c.lr gov year i.code, r
* Model 2
glm multi100 c.lr##c.lr gov year i.code, link(logit) fam(bin) robust
* Model 3
reg humi100  c.lr##c.lr gov year  i.code, r
* Model 4
glm humi100 c.lr##c.lr gov year i.code, link(logit) fam(bin) robust
* Model 5
reg war100  c.lr##c.lr gov year  i.code, r
* Model 6
glm war100 c.lr##c.lr gov year i.code, link(logit) fam(bin) robust

**** replicate Figure 1

glm multi100 c.lr##c.lr gov year i.code, link(logit) fam(bin) robust

set scheme plottig 
margins,   at(lr=(0 (.5) 10) (mean) _all) 
marginsplot,  ytitle("Predicted value of Multilateralism", axis(1)) title("") ///
 addplot(hist lr, percent yaxis(2) bin(20) lwidth(thin) color(none) lcolor(gs10) yscale(alt axis(2))) ///
legend(off)  xsca(titlegap(2)) ///
xtitle(Left-Right)  xlabel(0(.5)9)  

margins, dydx(lr) at(lr=(0 (.5) 9) (mean) _all) 
marginsplot, yline(0)  ytitle("Marginal Effect of Left-Right", axis(1)) title("") ///
 addplot(hist lr, percent yaxis(2) bin(20) lwidth(thin) color(none) lcolor(gs10) yscale(alt axis(2))) ///
legend(off)  xsca(titlegap(2))  ///
xtitle(Left-Right)  xlabel(0(.5)9)  

**** replicate Figure 2

glm war100 c.lr##c.lr gov year i.code, link(logit) fam(bin) robust

set scheme plottig 
margins,   at(lr=(0 (.5) 10) (mean) _all) 
marginsplot,  ytitle("Predicted value of Military", axis(1)) title("") ///
 addplot(hist lr, percent yaxis(2) bin(20) lwidth(thin) color(none) lcolor(gs10) yscale(alt axis(2))) ///
legend(off)  xsca(titlegap(2)) ///
xtitle(Left-Right)  xlabel(0(.5)9)   

margins, dydx(lr) at(lr=(0 (.5) 9) (mean) _all) 
marginsplot, yline(0)  ytitle("Marginal Effect of Left-Right", axis(1)) title("") ///
 addplot(hist lr, percent yaxis(2) bin(20) lwidth(thin) color(none) lcolor(gs10) yscale(alt axis(2))) ///
legend(off)  xsca(titlegap(2))  ///
xtitle(Left-Right)  xlabel(0(.5)9) 